package org.zhuxian.cn.controller;

import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zhuxian.cn.entity.DTO.StatisticsDTO;
import org.zhuxian.cn.result.JsonResult;
import org.zhuxian.cn.service.StatisticsService;

@Api(tags = "统计接口", description = "系统统计数据接口")
@RestController
@RequestMapping("/count")
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticsService statisticsService;

    @Operation(summary = "获取系统统计数据", description = "获取系统中的用户总数和配装总数")
    @GetMapping("/all")
    public JsonResult<StatisticsDTO> getSystemStatistics() {
        StatisticsDTO statistics = statisticsService.getSystemStatistics();
        return new JsonResult(200, "OK", statistics);
    }
}